package cn.medemede.k2;


public class Circle implements Shape {

    double PI=3.141593;
    String name;
    double r;

    Circle(double r) {
        name="圆形";
        this.r = r;
    }

    Circle() {
        name="圆形";
    }

    @Override
    public double area() {
        return PI*r*r;
    }

    @Override
    public double perimeter() {
        return PI*r*2;
    }

    @Override
    public void show() {
        System.out.println(this.toString());
    }

    @Override
    public String toString() {
        return "Circle{" +
                "r=" + r +
                ", name='" + name + '\'' +
                '}';
    }
}
